import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class Solution506 {
    public String[] findRelativeRanks(int[] score) {
        Map<Integer,Integer> map=new HashMap<>();
        int[] temp= Arrays.copyOf(score,score.length);
        Arrays.sort(temp);
        for (int i=temp.length-1;i>=0;i--){
            map.put(temp[i],temp.length-i);
        }
        String[] strings=new String[score.length];
        for (int i=0;i<score.length;i++){
            if (map.get(score[i])==1){
                strings[i]="Gold Medal";
            }else if (map.get(score[i])==2){
                strings[i]="Silver Medal";
            }else if (map.get(score[i])==3){
                strings[i]="Bronze Medal";
            }else{
                strings[i]=String.valueOf(map.get(score[i]));
            }
        }
        return strings;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(new Solution506().findRelativeRanks(new int[]{5,4,3,2,1})));
    }
}
